import Vue from 'vue'
import Router from 'vue-router'
import Recommend from 'components/recommend/recommend'
import Singer from 'components/singer/singer'
import Rank from 'components/rank/rand'
import Search from 'components/search/search'
import SingerDetail from 'components/singer-detall/singer-detall'
import Disc from 'components/disc/disc'
import TopList from 'components/top-list/top-list'
import UserCenter from 'components/user-center/user-center'
//我的首页
import MyPage from 'components/myIndex/myIndexPage'
import FreePage from 'components/freepage/freepage'
//零元福利
import welfare from 'components/welfare/welfare'
import login from 'components/login/login'

//商品详情
import StoryDetail from 'components/detail/detail.vue'
import StoryDetailFree from 'components/detail/detailFree.vue'
import detailXXZL from 'components/detail/detailXXZL'
//联系我们
import lxwmPage from 'components/myIndex/lianxiwomen.vue'

//联系我们
import fenxiangfanxian from 'components/welfare/fenxiangfanxian.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/detailXXZL',
      name: 'detailXXZL',
      component: detailXXZL,
    },
    {
      path: '/StoryDetailFree',
      name: 'StoryDetailFree',
      component: StoryDetailFree,
    },
    {
      path: '/fenxiangfanxian',
      name: 'fenxiangfanxian',
      component: fenxiangfanxian,
    },
    {
      path: '/lxwmPage',
      name: 'lxwmPage',
      component: lxwmPage,
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    {
      path: '/FreePage',
      name: 'FreePage',
      component: FreePage,
    },
    {
      path: '/welfare',
      name: 'welfare',
      component: welfare,
    },
    {
      path: '/StoryDetail',
      name: 'StoryDetail',
      component: StoryDetail,
    },
    {
      path: '/MyPage',
      name: 'MyPage',
      component: MyPage,
    },
    {
      path: '/',
      name: '/',
      redirect: '/recommend'
    },
    {
      path: '/recommend',
      name: 'Recommend',
      component: Recommend,
      children: [ //配置子路由
        {
          path: ':id',
          component: Disc
        }
      ]
    },
    {
      path: '/singer',
      name: 'Singer',
      component: Singer,
      children: [ //配置子路由
        {
          path: ':id',
          component: SingerDetail
        }
      ]
    },
    {
      path: '/rank',
      name: 'Rank',
      component: Rank,
      children: [ //配置子路由
        {
          path: ':id',
          component: TopList
        }
      ]
    },
    {
      path: '/search',
      name: 'Search',
      component: Search,
      children: [ //配置子路由
        {
          path: ':id',
          component: SingerDetail
        }
      ]
    },
    {
      path: '/user',
      name: 'UserCenter',
      component: UserCenter,
    }
  ]
})
